package com.itfetter.trade.listener;

import com.itfetter.trade.service.IOrderService;
import lombok.RequiredArgsConstructor;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "rocketmq-consumer-trade",topic = "pay-success")
@RequiredArgsConstructor
public class PayStatusListener implements RocketMQListener<String> {
private final IOrderService orderService;
    @Override
    public void onMessage(String s) {
        orderService.markOrderPaySuccess(Long.valueOf(s));
    }
}
